<template>
  <div>
    <span v-for="item in arr" :key="item">
      {{ item }}
      <input type="checkbox" v-model="ische" :value="item" />
    </span>

    <h4>你选中的元素，累加的值的和为:{{ newarr1 }}</h4>
  </div>
</template>

<script>
export default {
  data () {
    return {
      arr: [9, 15, 19, 25, 29, 31, 48, 57, 62, 79, 87],
      ische: []
    }
  },

  created () {},

  methods: {},
  computed: {
    newarr1 () {
      console.log(this.ische)
      return this.ische.reduce((sum, item) => {
        return (sum += item)
      }, 0)
    }
  }
}
</script>

<style scoped lang="less"></style>
